<template>
    <view @click.stop="copyText">
        <slot></slot>
    </view>
  </template>
  
  <script>
  export default {
    props: {
      data: {
        type: String,
        default: ''
      }
    },
    methods: {
      copyText() {
        uni.setClipboardData({
          data: this.data,
          success: () => {
            uni.showToast({
              title: '已复制',
              icon: 'none'
            });
          }
        });
      }
    }
  };
  </script>